import React from 'react';
import ReactDOM from 'react-dom';
import { Table, Icon } from 'antd';
import ajax from '../../../utils/ajax';
import Logger from '../../../utils/Logger';

const logger = Logger.getLogger('ReportTables');

//生成表格列信息
const columns = [{
  width:80,
  title: '预约类型',
  dataIndex: 'appointmentOrderTypeStr',
  key: 'appointmentOrderTypeStr'
},{
  width:80,
  title: '票种',
  dataIndex: 'type',
  key: 'type',
  render:(text,record)=>{
      if(text==1){
         return "个人"
      }else{
         return "团体"
      }
  }
}, {
  title: '预约场次',
  dataIndex: 'disparkSeasonInfo',
  key: 'disparkSeasonInfo',
}, {
  title: '预约人数',
  dataIndex: 'appointmentPersonInfo',
  key: 'appointmentPersonInfo',
},{
  width:80,
  title: '总价(元)',
  dataIndex: 'totalPrice',
  key: 'totalPrice',
}, {
  title: '预约信息',
  dataIndex: 'appointmentContactsStr',
  key: 'appointmentContactsStr',

}];

/**
 * 报表表格组件
 */
class ReportTables extends React.Component {
  constructor(props) {
    super(props);
  }

  
  componentWillReceiveProps = (nextProps) => {
     this.setState({
        reportData: nextProps.reportData > this.props.reportData
     });
  }

  render(){return (
       <Table 
          columns={columns} 
          dataSource={this.props.reportData}
       />
  );}
}

export default ReportTables;